<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAreasTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('areas', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',90)->comment('地区名称');
            $table->unsignedBigInteger('parent_id',false)->default(0)->index()->comment('父id');
            $table->unsignedInteger('listorder',false)->default(0)->comment('排序');
            $table->unsignedInteger('deep',false)->default(0)->comment('深度');
            $table->string('region',90)->nullable()->comment('大区名称');
            $table->timestamps();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('areas');
    }
}
